<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
      xmlns="http://www.w3.org/1999/html">

<head>

    <!--MyHeader-->
    <div th:include="common::MyHeader"></div>
    <!-- End of MyHeader -->
    <link rel="stylesheet" th:href="@{/ztree/3.5/css/default/zTreeStyle.css}">
    <link th:href="@{/ztree/3.5/css/metro/zTreeStyle.css}" rel="stylesheet"/>

</head>

<body id="page-top">

<!-- Page Wrapper -->
<div id="wrapper">

    <!-- Sidebar -->
    <ul th:replace="common::Sidebar(${session.user.loginName},${session.role.roleName})"></ul>
    <!-- End of Sidebar -->

    <!-- Content Wrapper -->
    <div id="content-wrapper" class="d-flex flex-column">

        <!-- Main Content -->
        <div id="content">

            <!-- Topbar -->
            <div th:include="common::Topbar(${session.user.userName})"></div>
            <!-- End of Topbar -->

            <!-- Begin Page Content -->
            <div class="container-fluid">

                <!-- Page Heading -->
                <div class="d-sm-flex align-items-center justify-content-between mb-4">
                    <h1 class="h3 mb-0 text-gray-800">编辑课程<strong th:text="${Authority}" style="color: red"></strong></h1>
                </div>

                <!-- Content Row -->
                <div class="row">

                    <div style="padding-left: 5%" class="col-lg-10">
                        <div class="form-row">
                            <div class="form-group col-lg-6">
                                <label for="inputName">课程名</label>
                                <input type="text" class="form-control" id="inputName" th:value="${course.getCourseName()}">
                            </div>
                            <div class="form-group col-md-6">
                                <label for="inputRoom">开课教室</label>
                                <input type="text" class="form-control" id="inputRoom" th:value="${course.getClassroom()}">
                            </div>
                        </div>

                        <div class="card">
                            <div class="card-header">开课时间</div>
                            <div class=" card-body">
                                <div class="form-row">
                                    <div class="form-group col-md-2">
                                        <label class="small font-weight-bold" for="inputStart">开始周</label>
                                        <select id="inputStart" class="form-control" >
                                            <option value="" selected></option>
                                            <option value="1">1</option>
                                            <option value="2">2</option>
                                            <option value="3">3</option>
                                            <option value="4">4</option>
                                            <option value="5">5</option>
                                            <option value="6">6</option>
                                            <option value="7">7</option>
                                            <option value="8">8</option>
                                            <option value="9">9</option>
                                            <option value="10">10</option>
                                            <option value="11">11</option>
                                            <option value="12">12</option>
                                            <option value="13">13</option>
                                            <option value="14">14</option>
                                            <option value="15">15</option>
                                            <option value="16">16</option>
                                            <option value="17">17</option>
                                            <option value="18">18</option>
                                            <option value="19">19</option>
                                            <option value="20">20</option>
                                            <option value="21">21</option>
                                            <option value="22">22</option>
                                        </select>
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label for="inputEnd" class="small font-weight-bold">结束周</label>
                                        <select id="inputEnd" class="form-control">
                                            <option value="" selected></option>
                                            <option value="1">1</option>
                                            <option value="2">2</option>
                                            <option value="3">3</option>
                                            <option value="4">4</option>
                                            <option value="5">5</option>
                                            <option value="6">6</option>
                                            <option value="7">7</option>
                                            <option value="8">8</option>
                                            <option value="9">9</option>
                                            <option value="10">10</option>
                                            <option value="11">11</option>
                                            <option value="12">12</option>
                                            <option value="13">13</option>
                                            <option value="14">14</option>
                                            <option value="15">15</option>
                                            <option value="16">16</option>
                                            <option value="17">17</option>
                                            <option value="18">18</option>
                                            <option value="19">19</option>
                                            <option value="20">20</option>
                                            <option value="21">21</option>
                                            <option value="22">22</option>
                                        </select>
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label for="inputWeek1" class="small font-weight-bold">星期</label>
                                        <select id="inputWeek1" class="form-control">
                                            <option value="" selected></option>
                                            <option value="1">1</option>
                                            <option value="2">2</option>
                                            <option value="3">3</option>
                                            <option value="4">4</option>
                                            <option value="5">5</option>
                                            <option value="6">6</option>
                                            <option value="7">7</option>
                                        </select>
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label for="inputSLesson1" class="small font-weight-bold">起始(节)</label>
                                        <select id="inputSLesson1" class="form-control">
                                            <option value="" selected></option>
                                            <option value="1">1</option>
                                            <option value="2">2</option>
                                            <option value="3">3</option>
                                            <option value="4">4</option>
                                            <option value="5">5</option>
                                            <option value="6">6</option>
                                            <option value="7">7</option>
                                            <option value="8">8</option>
                                            <option value="9">9</option>
                                            <option value="10">10</option>
                                            <option value="11">11</option>
                                            <option value="12">12</option>
                                        </select>
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label for="inputElesson1" class="small font-weight-bold">结束(节)</label>
                                        <select id="inputElesson1" class="form-control">
                                            <option value="" selected></option>
                                            <option value="1">1</option>
                                            <option value="2">2</option>
                                            <option value="3">3</option>
                                            <option value="4">4</option>
                                            <option value="5">5</option>
                                            <option value="6">6</option>
                                            <option value="7">7</option>
                                            <option value="8">8</option>
                                            <option value="9">9</option>
                                            <option value="10">10</option>
                                            <option value="11">11</option>
                                            <option value="12">12</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-4 text-black-50">选填补充*</div>
                                    <div class="form-group col-md-2">
                                        <label for="inputWeek2" class="small font-weight-bold">星期</label>
                                        <select id="inputWeek2" class="form-control">
                                            <option value="" selected></option>
                                            <option value="1">1</option>
                                            <option value="2">2</option>
                                            <option value="3">3</option>
                                            <option value="4">4</option>
                                            <option value="5">5</option>
                                            <option value="6">6</option>
                                            <option value="7">7</option>
                                        </select>
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label for="inputSLesson2" class="small font-weight-bold">起始(节)</label>
                                        <select id="inputSLesson2" class="form-control">
                                            <option value="" selected></option>
                                            <option value="1">1</option>
                                            <option value="2">2</option>
                                            <option value="3">3</option>
                                            <option value="4">4</option>
                                            <option value="5">5</option>
                                            <option value="6">6</option>
                                            <option value="7">7</option>
                                            <option value="8">8</option>
                                            <option value="9">9</option>
                                            <option value="10">10</option>
                                            <option value="11">11</option>
                                            <option value="12">12</option>
                                        </select>
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label for="inputElesson2" class="small font-weight-bold">结束(节)</label>
                                        <select id="inputElesson2" class="form-control">
                                            <option value="" selected></option>
                                            <option value="1">1</option>
                                            <option value="2">2</option>
                                            <option value="3">3</option>
                                            <option value="4">4</option>
                                            <option value="5">5</option>
                                            <option value="6">6</option>
                                            <option value="7">7</option>
                                            <option value="8">8</option>
                                            <option value="9">9</option>
                                            <option value="10">10</option>
                                            <option value="11">11</option>
                                            <option value="12">12</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-4 text-black-50">选填补充*</div>
                                    <div class="form-group col-md-2">
                                        <label for="inputWeek3" class="small font-weight-bold">星期</label>
                                        <select id="inputWeek3" class="form-control">
                                            <option value="" selected></option>
                                            <option value="1">1</option>
                                            <option value="2">2</option>
                                            <option value="3">3</option>
                                            <option value="4">4</option>
                                            <option value="5">5</option>
                                            <option value="6">6</option>
                                            <option value="7">7</option>
                                        </select>
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label for="inputSLesson3" class="small font-weight-bold">起始(节)</label>
                                        <select id="inputSLesson3" class="form-control">
                                            <option value="" selected></option>
                                            <option value="1">1</option>
                                            <option value="2">2</option>
                                            <option value="3">3</option>
                                            <option value="4">4</option>
                                            <option value="5">5</option>
                                            <option value="6">6</option>
                                            <option value="7">7</option>
                                            <option value="8">8</option>
                                            <option value="9">9</option>
                                            <option value="10">10</option>
                                            <option value="11">11</option>
                                            <option value="12">12</option>
                                        </select>
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label for="inputElesson3" class="small font-weight-bold">结束(节)</label>
                                        <select id="inputElesson3" class="form-control">
                                            <option value="" selected></option>
                                            <option value="1">1</option>
                                            <option value="2">2</option>
                                            <option value="3">3</option>
                                            <option value="4">4</option>
                                            <option value="5">5</option>
                                            <option value="6">6</option>
                                            <option value="7">7</option>
                                            <option value="8">8</option>
                                            <option value="9">9</option>
                                            <option value="10">10</option>
                                            <option value="11">11</option>
                                            <option value="12">12</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="form-row">
                            <div class="form-group col-md-6">
                                <label for="inputCount">开课人数</label>
                                <input type="number" class="form-control" id="inputCount" th:value="${course.count}">
                            </div>
                            <div class="form-group col-md-6">
                                <label for="inputCredit">课程学分</label>
                                <input type="number" class="form-control" id="inputCredit" step="0.1" th:value="${course.credit}">
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="remark">备注</label>
                            <textarea class="form-control" id="remark" rows="3" th:text="${course.remarks}"></textarea>
                        </div>

                        <input hidden="hidden" id="inputDeptId" name="deptId" value="" th:value="${course.deptId}">
                        <input hidden="hidden" id="courseIdInput" name="courseId" value="" th:value="${course.courseId}">

                        <div class="form-group">
                            <label for="remark">开放的学院</label>
                            <div class="row">
                                <div class="col-md-12">
                                    <div id="tree" class="ztree"></div>
                                </div>
                            </div>
                        </div>


                        <button  class="btn btn-primary" id="editBtn" onclick="editBtn()">确定修改</button>

                    </div>


                </div>


            </div>
            <!-- /.container-fluid -->

        </div>
        <!-- End of Main Content -->

        <!-- Footer -->
        <div th:include="common::Footer"></div>
        <script th:src="@{/ztree/3.5/js/jquery.ztree.core-3.5.js}"></script>
        <script th:src="@{/js/course_create.js}"></script>

        <!-- End of Footer -->

    </div>
    <!-- End of Content Wrapper -->

</div>
<!-- End of Page Wrapper -->

<!-- Scroll to Top Button-->
<a class="scroll-to-top rounded" href="#page-top">
    <i class="fas fa-angle-up"></i>
</a>

<!-- Logout Modal-->
<div th:include="common::LogoutModal"></div>

</body>

</html>
<script src="/js/course_create.js"></script>